package com.bzkj.web.controller.wms;

import com.bzkj.basicinfo.domain.wms.WmsBillsTypeBillsStatusEntity;
import com.bzkj.basicinfo.service.WmsBillsTypeBillsStatusService;
import com.bzkj.common.annotation.LogC;
import com.bzkj.common.core.domain.AjaxResult;
import com.bzkj.common.core.domain.R;
import com.bzkj.common.enums.BusinessType;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Date 2025/01/16 10:33:38
 * @description 单据状态单据类型关联表
 */
@RestController
@RequestMapping("wms/bills/type/bills/status")
public class WmsBillsTypeBillsStatusController
{
    @Autowired
    private WmsBillsTypeBillsStatusService wmsBillsTypeBillsStatusService;

    /**
     * 获取所有单据状态
     * @return
     */
    @ApiOperation("查询接口")
    @RequestMapping("getBillsData")
    public R getBillsData(){
        return wmsBillsTypeBillsStatusService.getBillsData();
    }

    /**
     * 保存单据状态单据类型关联表
     * @param entity
     * @return
     */
    @ApiOperation("新增接口")
    @PostMapping("saveBillsInfo")
    @LogC(title = "单据关联", businessType = BusinessType.INSERT, pkFieldNames = "stu_class_id",
            tableNames = "wms_bills_type_bills_status",content = "' 单据类型状态id：'+#entity.billsTypeStatusId"
    )
    public AjaxResult saveBillsInfo(@RequestBody WmsBillsTypeBillsStatusEntity entity){
        return wmsBillsTypeBillsStatusService.saveBillsInfo(entity);
    }

    /**
     * 修改单据状态单据类型关联表
     * @param id
     * @return
     */
    @ApiOperation("关闭接口")
    @PutMapping("putBillsEnableStatus")
    @LogC(title = "单据关联", businessType = BusinessType.UPDATE, pkFieldNames = "id",
            tableNames = "wms_bills_type_bills_status",content = "'单据类型状态表主键：'+#id"
    )
    public R putBillsEnableStatus(@RequestParam Integer id){
        return wmsBillsTypeBillsStatusService.putBillsEnableStatus(id);

    }

}